<!--  -->
<template>
<div class='skill-page'>
    <div class="flex-sp">
        <div class="flex">
            <img src="../../../../assets/webp (12).png" alt="" class="skill-img">
            <div>
                <span>{{hours}}</span>
                <span>:</span>
                <span>{{mins}}</span>
                <span>:</span>
                <span>{{senc}}</span>
            </div>
        </div>
        <div class="flex">
            <div>更多</div>
            <i class="iconfont icon-xiaojiantou"></i>
        </div>
    </div>
    <!-- 商品展示 -->
    <div class="shop-big-box">
        <div class="shop-box">
            <img src="../../../../assets/logo.png" alt="">
            <div class="shop-desc">产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题</div>
            <div class="shop-price">99.00</div>
            <div class="make-price">1999</div>
        </div>
         <div class="shop-box">
            <img src="../../../../assets/logo.png" alt="">
            <div class="shop-desc">产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题</div>
            <div class="shop-price">99.00</div>
            <div class="make-price">1999</div>
        </div>
         <div class="shop-box">
            <img src="../../../../assets/logo.png" alt="">
            <div class="shop-desc">产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题</div>
            <div class="shop-price">99.00</div>
            <div class="make-price">1999</div>
        </div>
         <div class="shop-box">
            <img src="../../../../assets/logo.png" alt="">
            <div class="shop-desc">产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题</div>
            <div class="shop-price">99.00</div>
            <div class="make-price">1999</div>
        </div>
         <div class="shop-box">
            <img src="../../../../assets/logo.png" alt="">
            <div class="shop-desc">产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题</div>
            <div class="shop-price">99.00</div>
            <div class="make-price">1999</div>
        </div>
         <div class="shop-box">
            <img src="../../../../assets/logo.png" alt="">
            <div class="shop-desc">产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题产品标题</div>
            <div class="shop-price">99.00</div>
            <div class="make-price">1999</div>
        </div>
    </div>
</div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
//import引入的组件需要注入到对象中才能使用
components: {},
data() {
//这里存放数据
return {
    hours:'00',
    mins:'00',
    senc:'00',
    timer:''
};
},
//监听属性 类似于data概念
computed: {},
//监控data中的数据变化
watch: {},
//方法集合
methods: {
    skill(){
        let nowData = new Date();//获取当前时间
        let targetTime = new Date('2022-06-17 23:59:59');//目标时间
        let time = (targetTime - nowData)/1000//时间换算成秒数
        // 剩余的小时
        this.hours = Math.floor(time/60/60);//向下取整 小时数
        if(this.hours<=9 && this.hours>=0){
            this.hours = '0' + this.hours
        }
        // 剩余的分钟数
        this.mins = Math.floor((time%3600)/60)
        if(this.mins<=9 && this.mins>=0){
            this.mins = '0' + this.mins
        }
        //剩下的秒数
        this.senc = Math.floor(time%60)
        if(this.senc<=9 && this.senc>=0){
            this.senc = '0' + this.senc
        }
    }
},
beforeCreate() {}, //生命周期 - 创建之前
//生命周期 - 创建完成（可以访问当前this实例）
created() {

},
beforeMount() {}, //生命周期 - 挂载之前
//生命周期 - 挂载完成（可以访问DOM元素）
mounted() {
   this.timer= setInterval(this.skill,1000)
},
beforeUpdate() {}, //生命周期 - 更新之前
updated() {}, //生命周期 - 更新之后
beforeDestroy() {}, //生命周期 - 销毁之前
destroyed() {
    clearInterval(this.timer)
}, //生命周期 - 销毁完成
activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style lang="less" scoped>

.skill-page{
    padding:0 1rem;
    .skill-img{
        width:7rem;
        height:1.5rem
    }
    .shop-big-box{
        display: flex;
        align-items: center;
overflow-x: auto;
    .shop-box{
        margin-right: 1.5rem;
        img{
            width: 10rem;
            height:10rem;
        }
        .shop-desc{
            overflow: hidden;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 2;
        }
        .shop-price{
            color: #ff534c;
            text-align: center;
            &::before{
                content:'￥'
            }
        }
        .make-price{
            color:#666;
            text-decoration: line-through;
            text-align: center;
             &::before{
                content:'￥'
            }
        }

    }
    }
}


</style>